#ifndef SERIALPORTMANAGER_H
#define SERIALPORTMANAGER_H

#include <QObject>
#include <QStringList>
#include "qextserialport.h"

class SerialPortManager : public QObject
{
    Q_OBJECT
public:
    explicit SerialPortManager(QObject *parent = 0);
    ~SerialPortManager();

    void OpenPort(QString PortString);
    void ClosePort();
    
    QString ReadLine();
    bool HasLinesToRead();
    void SendLine(QString line);
signals:
    void LineReadyToRead();
public slots:


private slots:
    void BufferData();
private:
    QextSerialPort Port;
    QStringList BufferedLines;
    QString Buffer;
};

#endif // SERIALPORTMANAGER_H
